<template>
  <ant-modal
    modalWidth="600"
    modalHeight="450"
    :visible="open"
    v-if="open"
    :modal-title="formTitle"
    :adjust-size="true"
    :maskClosable="false"
    @cancel="cancel"
  >
    <a-form-model ref="form" :model="form"  slot="content" layout="vertical" style="padding:0 20px">
      <a-row :gutter="32">
        <a-col :xs="12" :sm="8">
          <a-form-model-item label="关联测量单" prop="remark">
            <a-input v-if="!bizMeasureId" :readOnly="true" v-model="form.measureNumber" placeholder="请关联测量单" @click="handleChooseMeasure"/>
            <a-input v-else :readOnly="true" v-model="form.measureNumber" placeholder="请关联测量单" />
          </a-form-model-item>
        </a-col>
        <a-col :xs="12" :sm="8">
          <a-form-model-item label="备注" prop="remark">
            <a-input :readOnly="true" v-model="form.remark" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="24" :md="24" :sm="24">
          <a-form-model-item label="测量图片">
            <a-upload
              :headers="headers"
              :file-list="fileList"
              list-type="picture-card"
              :customRequest="handleChange"
              :remove='handleRemove'
            >
                上传
            </a-upload>
          </a-form-model-item>
        </a-col>
      </a-row>
      <BizMeasureListForm ref="BizMeasureListForm" @ok="selectOk"></BizMeasureListForm>
    </a-form-model>
      <template slot="footer">
          <a-button @click="cancel">
            取消
          </a-button>
          <a-button type="primary" :disabled="false" @click="submitForm(true)">
            保存
          </a-button>
        </template>
  </ant-modal>
</template>
<script>
import BizMeasureForm from './BizMeasureForm'
export default {
  ...BizMeasureForm
}
</script>
<style lang="less" scoped>
.table-operations, body tr.ant-table-expanded-row:hover .table-operations {
  padding-bottom: 8px;
  text-align: right;
}
.table-operations {
  margin-bottom: 16px;
}
.table-operations > button,
.table-operations .ant-input-affix-wrapper{
  margin-right: 8px;
}
.table_title {
  float: left;
  padding-left: 8px;
  font-weight: 600;
  color: #222222;
  line-height: 30px;
}
</style>
